//
//  Coordinator.h
//  LockTest
//
//  Created by ZhangBo on 2018/12/2.
//  Copyright © 2018 ZhangBo. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface Producer : NSObject
@property(nonatomic, assign) BOOL shouldProduce;
@property(nonatomic, strong) NSString *itemName;
@property(nonatomic, strong) NSCondition *condition;
@property(nonatomic, strong) NSMutableArray *collector;

- (instancetype)initWithConditon:(NSCondition *)condition collector:(NSMutableArray *)collector;

- (void)produce;
@end

@interface Consumer : NSObject
@property(nonatomic, assign) BOOL shouldConsumer;
@property(nonatomic, strong) NSString *itemName;
@property(nonatomic, strong) NSCondition *condition;
@property(nonatomic, strong) NSMutableArray *collector;

- (instancetype)initWithConditon:(NSCondition *)condition collector:(NSMutableArray *)collector;

- (void)consumer;
@end

@interface Coordinator : NSObject
- (void)start;
@end

NS_ASSUME_NONNULL_END
